﻿@using TrainingReminderSystem.Bll
@{
    ViewData["Title"] = "首页";
}
项目名称:@(Html.Raw(SysConfig.ProjectName))
<br />
端口号:@(Html.Raw(SysConfig.WebSocketPortChat));启动:@(Html.Raw(WebSocketBll.WebSocketSuccess));
@*<button onclick="testAjax()">测试ajax</button>
    <button onclick="testAjax2()">测试webapiAjax</button>
    <button onclick="testAjax3()">测试异常</button>
    <button onclick="testAjax4()">测试并发</button>
    <button onclick="someTest()">测试</button>*@
@section Scripts{
<script type="text/javascript">
    function getSearch() {
        return { index: 1, ProjectName: '测试' };
    }

    function testAjax() {
        $.post("@Url.Action("Index", "Home")",
            getSearch(),
            function(data) {
                console.log(data);
            });
    }

    function testAjax2() {
        $.post("api/Public/ProjectList",
            getSearch(),
            function(data) {
                console.log(data);
            });
    }

    function testAjax3() {
        $.post("api/Public/TblTestAdd?testA=abcdef",
            {
                TblTestName: 'test'
            },
            function(data) {
                console.log(data);
            });
    }

    function testAjax4() {
        $.post("api/Public/TblTestGet",
            {
                ID: 35,
                Name: '123测试'
            },
            function(data) {
                var r = data.Result;
                console.log(r);
                r.TblTestName = 'test8';
                $.post("api/Public/TblTestAdd",
                    r,
                    function(dataX) {
                        console.log(dataX);
                    });
                r.TblTestName = 'test10';
                $.post("apiUrlPublic/TblTestAdd",
                    r,
                    function(dataY) {
                        console.log(dataY);
                    });
                r.ID = 33;
                r.TblTestName = 'test11';
                $.post("api/Public/TblTestAdd",
                    r,
                    function(dataY) {
                        console.log(dataY);
                    });
            });
    }

    function someTest() {
        $.post("@Url.Action("SomeTest", "Home")", {}, function (data) {
            console.log(JSON.stringify(data));
        });
    }
</script>
}
